package com.tencent50.easy;

/**
 * @author: zhengtao
 * @description: 237. 删除链表中的节点,看答案出来的，想办法干掉自生节点,(那干掉下个节点，把下个节点的值给自己，然后干掉他即可)
 * @version: 1.0
 * @date: 2022/07/25  22:39
 */
public class Demo19 {
    public void deleteNode(ListNode node) {
        while (node!=node){
            node.val=node.next.val;
            node.next=node.next.next;
        }

    }


    public class ListNode {
        int val;
        ListNode next;
        ListNode(int x) { val = x; }
    }

}
